﻿Public Class BBrowserNews

    Private Sub BBrowserNews_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If (My.Computer.FileSystem.FileExists("C:\bbrowsernews.txt")) Then
            My.Computer.FileSystem.DeleteFile("C:\bbrowsernews.txt")
        End If

        My.Computer.Network.DownloadFile("http://bbrowser.weebly.com/uploads/4/3/7/1/4371454/bbrowsernews.txt", "C:\bbrowsernews.txt")

        If (My.Computer.FileSystem.FileExists("C:\bbrowsernews.txt")) Then
            'Continue
        Else
            TextBox1.Text = "Unable to connect to the internet to download latest news. Please make sure you have internet connection and try again."
            Exit Sub
        End If

        Dim thenews As String = My.Computer.FileSystem.ReadAllText("C:\bbrowsernews.txt")
        TextBox1.Text = thenews
        TextBox1.SelectedText = Nothing
    End Sub
End Class